#include <adcatch.hpp>
#include <settings.hpp>

static int ADC1_CHS[] = { 0, 1, 2, 3, 4 };

static ADCatch* s_ADCatch = nullptr;

ADCatch* ADCatch::Instance()
{
	if (s_ADCatch == nullptr)
	{
		s_ADCatch = new ADCatch();
	}
	return s_ADCatch;
}

ADCatch::ADCatch()
	: ADC(E_ADC1, ADC1_CHS, 5)
{
}

ADCatch::~ADCatch()
{
}

void ADCatch::Init()
{
}

void ADCatch::RunImpl(uint16_t& result, int adc, int channel)
{
	Transfer(result, E_ADC1, ADC1_CHS[channel]);
}